using Pvp.Ecs;

namespace Pvp.Stage
{
    public class GameStage
    {
        private StageLogicData _stageData;

        public GameStage(StageLogicData data)
        {
            _stageData = data;
        }

        public void CreateStageEntity()
        {
            foreach (var box in _stageData.stageBox)
            {
                Entity.CreateEntity((int) EntityType.stageBox,box.boxTypeId,box);
            }

            foreach (var gear in _stageData.stageGear)
            {
                Entity.CreateEntity((int) EntityType.gear,gear.gearTypeId,gear);
            }
                
            foreach (var monster in _stageData.stageMonster)
            {
                Entity.CreateEntity((int) EntityType.monster,monster.monsterTypeId,monster);
            }
                
            foreach (var npc in _stageData.stageNpc)
            {
                Entity.CreateEntity((int) EntityType.npc, npc.npcTypeId,npc);
            }
                
            foreach (var birthPoint in _stageData.stageBirthPoint)
            {
                Entity.CreateEntity((int) EntityType.birthPoint,birthPoint.birthPointTypeId,birthPoint);
            }
                
            foreach (var gatherPoint in _stageData.stageGatherPoint)
            {
                Entity.CreateEntity((int) EntityType.resGatherPoint,gatherPoint.resGatherTypeId,gatherPoint);
            }
                
            Entity.CreateEntity((int) EntityType.path, 0, _stageData.stagePathMatrix);
        }
    }
}